#!D:/CODE/python
# -*- coding: utf-8 -*-
# @Time : 2020/5/25 18:08
# @Author : Alexdong
# @Site : 
# @File : 图片下载器.py
# @Software: PyCharm
# Functional description:
import urllib.request
import gevent
from gevent import monkey
def download(img_name, img_url):
    req = urllib.request.urlopen(img_url)
    img_content = req.read()

    with open(img_name, "wb") as f:
        f.write(img_content)

def main():
    gevent.joinall([
        gevent.spawn(download, "1.jpg", "网址"),
        gevent.spawn(download, "2.jpg", "网址")
    ])

if __name__ == "__main__":
    main()